package com.wcpdoc.survey.survey.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wcpdoc.survey.survey.entity.Survey;
import com.wcpdoc.survey.survey.entity.SurveyType;
import com.wcpdoc.survey.survey.service.SurveyService;
import com.wcpdoc.survey.survey.service.SurveyTypeExService;

/**
 * 调查分类扩展服务层实现
 * 
 * v1.0 zhanghc 2017-06-28 21:34:41
 */
@Service
public class SurveyTypeExServiceImpl implements SurveyTypeExService {

	@Resource
	private SurveyService surveyService;

	@Override
	public void delAndUpdate(SurveyType surveyType) {
		List<Survey> surveyList = surveyService.getList(surveyType.getId());
		for(Survey survey : surveyList){
			survey.setSurveyTypeId(1);
			surveyService.update(survey);
		}
	}
}
